package net.arvin.mobilebanksystem.fragment;

import net.arvin.dao.TransferDetailsAdapter;
import net.arvin.mobilebanksystem.R;
import net.arvin.model.TransfersBill;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

@SuppressLint("ValidFragment")
public class TransferDetailsFragment extends Fragment {
	private TransfersBill bill;
	private ListView listView;

	public TransferDetailsFragment() {
		super();
	}

	public TransferDetailsFragment(TransfersBill bill) {
		super();
		this.bill = bill.softListByTime(bill);
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_transfer_details, null);
		init(view);
		return view;
	}

	private void init(View view) {
		initView(view);
		initListener();
	}

	private void initListener() {
		listView.setAdapter(new TransferDetailsAdapter(bill, getActivity()));
	}

	private void initView(View view) {
		listView = (ListView) view.findViewById(R.id.transfer_details);
	}
}
